<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<meta name="theme-color" content="#222"><meta name="generator" content="Hexo 7.3.0">

  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32.ico">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16.ico">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">



<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" integrity="sha256-wiz7ZSCn/btzhjKDQBms9Hx4sSeUYsDrTLg7roPstac=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.1.1/animate.min.css" integrity="sha256-PR7ttpcvz8qrF57fur/yAx1qXMFJeJFiA6pSzWi0OIE=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fancyapps-ui/5.0.28/fancybox/fancybox.css" integrity="sha256-6cQIC71/iBIYXFK+0RHAvwmjwWzkWd+r7v/BX3/vZDc=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/pace/1.2.4/themes/green/pace-theme-minimal.css">
  <script src="https://cdnjs.cloudflare.com/ajax/libs/pace/1.2.4/pace.min.js" integrity="sha256-gqd7YTjg/BtfqWSwsJOvndl0Bxc8gFImLEkXQT8+qj0=" crossorigin="anonymous"></script>

<script class="next-config" data-name="main" type="application/json">{"hostname":"sumumm.github.io","root":"/","images":"/images","scheme":"Gemini","darkmode":false,"version":"8.19.2","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12},"copycode":{"enable":true,"style":"mac"},"fold":{"enable":true,"height":300},"bookmark":{"enable":false,"color":"#222","save":"auto"},"mediumzoom":false,"lazyload":true,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"stickytabs":false,"motion":{"enable":true,"async":true,"transition":{"menu_item":"fadeInDown","post_block":"fadeIn","post_header":"fadeInDown","post_body":"fadeInDown","coll_header":"fadeInLeft","sidebar":"fadeInUp"}},"i18n":{"placeholder":"搜索...","empty":"没有找到任何搜索结果：${query}","hits_time":"找到 ${hits} 个搜索结果（用时 ${time} 毫秒）","hits":"找到 ${hits} 个搜索结果"},"path":"/search.xml","localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false}}</script><script src="/js/config.js"></script>

    <meta name="description" content="本文主要是天猫蓝牙Mesh开发——环境搭建的相关笔记，若笔记中有错误或者不合适的地方，欢迎批评指正😃。">
<meta property="og:type" content="article">
<meta property="og:title" content="LV03-04-天猫蓝牙Mesh开发-01-环境搭建">
<meta property="og:url" content="https://sumumm.github.io/post/e0ca430.html">
<meta property="og:site_name" content="苏木">
<meta property="og:description" content="本文主要是天猫蓝牙Mesh开发——环境搭建的相关笔记，若笔记中有错误或者不合适的地方，欢迎批评指正😃。">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224134919434.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224135514491.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224135715616.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224140124639.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224140205917.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224141856681.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224141919765.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224142008391.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224142052356.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224142121017.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224142201704.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224145837573.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224150021454.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224150123010.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224150238722.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224155946202.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224155745597.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224155816360.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224160133543.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224160202108.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224143536122.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224150831920.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224151103163.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224151035182.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224151326972.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224152142211.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224162547354.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224162739896.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224162937907.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224163657374.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224164040634.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224164453888.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224164608705.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224165221702.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224165943002.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224170006187.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224170200465.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224170308922.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224170513025.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224170617445.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224171841137.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224173611879.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224184755255.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224184839784.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224174318921.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224174145676.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224174213061.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224174531457.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224174650086.png">
<meta property="article:published_time" content="2024-01-07T03:45:35.000Z">
<meta property="article:modified_time" content="2025-06-13T16:25:57.027Z">
<meta property="article:author" content="苏木">
<meta property="article:tag" content="LV21-天猫精灵IOT">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224134919434.png">


<link rel="canonical" href="https://sumumm.github.io/post/e0ca430.html">



<script class="next-config" data-name="page" type="application/json">{"sidebar":"","isHome":false,"isPost":true,"lang":"zh-CN","comments":true,"permalink":"https://sumumm.github.io/post/e0ca430.html","path":"post/e0ca430.html","title":"LV03-04-天猫蓝牙Mesh开发-01-环境搭建"}</script>

<script class="next-config" data-name="calendar" type="application/json">""</script>
<title>LV03-04-天猫蓝牙Mesh开发-01-环境搭建 | 苏木</title>
  








    <script src="/js/browser_tools_disable.js"></script>

  <noscript>
    <link rel="stylesheet" href="/css/noscript.css">
  </noscript>
<!-- hexo injector head_end start --><link rel="stylesheet" href="https://unpkg.com/hexo-next-tags-plus@latest/lib/tag_plus.css" media="defer" onload="this.media='all'"><!-- hexo injector head_end end --></head>

<body itemscope itemtype="http://schema.org/WebPage" class="use-motion">
  <div class="headband"></div>

  <main class="main">
    <div class="column">
      <header class="header" itemscope itemtype="http://schema.org/WPHeader"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏" role="button">
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <i class="logo-line"></i>
      <p class="site-title">苏木</p>
      <i class="logo-line"></i>
    </a>
      <p class="site-subtitle" itemprop="description">我的学习之路</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger" aria-label="搜索" role="button">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>



<nav class="site-nav">
  <ul class="main-menu menu"><li class="menu-item menu-item-home"><a href="/" rel="section"><i class="fa fa-home fa-fw"></i>苏木的家</a></li><li class="menu-item menu-item-categories"><a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类页<span class="badge">42</span></a></li><li class="menu-item menu-item-archives"><a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档页<span class="badge">673</span></a></li><li class="menu-item menu-item-flink"><a href="/flink/" rel="section"><i class="fa fa-link fa-fw"></i>友人帐</a></li><li class="menu-item menu-item-about"><a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于我</a></li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup"><div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off" maxlength="80"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close" role="button">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div class="search-result-container no-result">
  <div class="search-result-icon">
    <i class="fa fa-spinner fa-pulse fa-5x"></i>
  </div>
</div>

    </div>
  </div>

</header>
        
  
  <aside class="sidebar">

    <div class="sidebar-inner sidebar-nav-active sidebar-toc-active">
      <ul class="sidebar-nav">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <div class="sidebar-panel-container">
        <!--noindex-->
        <div class="post-toc-wrap sidebar-panel">
            <div class="post-toc animated"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#%E4%B8%80%E3%80%81%E5%BC%80%E5%8F%91%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA"><span class="nav-text">一、开发环境搭建</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1-%E7%A1%AC%E4%BB%B6%E8%AE%BE%E5%A4%87"><span class="nav-text">1. 硬件设备</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#1-1-%E6%9C%89%E5%93%AA%E4%BA%9B%EF%BC%9F"><span class="nav-text">1.1 有哪些？</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#1-2-%E6%B3%B0%E5%87%8C%E5%BE%AE8258%E6%A8%A1%E5%9D%97%E7%AE%80%E4%BB%8B"><span class="nav-text">1.2 泰凌微8258模块简介</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-%E8%BD%AF%E4%BB%B6%E4%B8%8ESDK"><span class="nav-text">2. 软件与SDK</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#2-1-%E8%93%9D%E7%89%99Mesh%E5%8D%8F%E8%AE%AE%E6%A0%88"><span class="nav-text">2.1 蓝牙Mesh协议栈</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2-2-Telink%E7%A8%8B%E5%BA%8F%E4%B8%8B%E8%BD%BD%E5%99%A8-%E5%85%8D%E9%A9%B1"><span class="nav-text">2.2 Telink程序下载器(免驱)  </span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2-3-VScode%E7%9B%B8%E5%85%B3"><span class="nav-text">2.3 VScode相关</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#2-3-1-vscode%E7%BC%96%E8%BE%91%E5%99%A8%E5%AE%89%E8%A3%85"><span class="nav-text">2.3.1 vscode编辑器安装</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#2-3-2-vscode%E6%8F%92%E4%BB%B6%E5%AE%89%E8%A3%85"><span class="nav-text">2.3.2 vscode插件安装</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2-4-pip%E5%AE%89%E8%A3%85aos"><span class="nav-text">2.4 pip安装aos</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#2-4-1-%E6%9B%B4%E6%96%B0pip"><span class="nav-text">2.4.1 更新pip</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#2-4-2-%E5%AE%89%E8%A3%85setuptools"><span class="nav-text">2.4.2 安装setuptools</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#2-4-3-%E5%AE%89%E8%A3%85wheels"><span class="nav-text">2.4.3 安装wheels</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#2-4-4-%E5%AE%89%E8%A3%85aos-cube"><span class="nav-text">2.4.4 安装aos-cube</span></a></li></ol></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#3-%E7%8E%AF%E5%A2%83%E9%85%8D%E7%BD%AE"><span class="nav-text">3. 环境配置</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#3-1-%E4%B8%BA%E4%BB%80%E4%B9%88%E4%B8%8D%E7%94%A8linux%EF%BC%9F"><span class="nav-text">3.1 为什么不用linux？</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3-2-%E5%88%9B%E5%BB%BAvscode%E5%B7%A5%E7%A8%8B"><span class="nav-text">3.2 创建vscode工程</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3-3-%E5%88%9B%E5%BB%BA-vscode%E7%9B%AE%E5%BD%95"><span class="nav-text">3.3 创建.vscode目录</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3-4-%E5%8F%AF%E8%A7%86%E5%92%8C%E6%90%9C%E7%B4%A2%E9%85%8D%E7%BD%AE"><span class="nav-text">3.4 可视和搜索配置</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3-5-%E9%85%8D%E7%BD%AE%E7%BC%96%E8%AF%91%E4%BB%BB%E5%8A%A1"><span class="nav-text">3.5 配置编译任务</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3-6-%E8%BF%90%E8%A1%8C%E4%BB%BB%E5%8A%A1"><span class="nav-text">3.6 运行任务</span></a></li></ol></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E4%BA%8C%E3%80%81%E5%B7%A5%E7%A8%8B%E5%88%9B%E5%BB%BA"><span class="nav-text">二、工程创建</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1-%E6%B7%BB%E5%8A%A0%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F"><span class="nav-text">1. 添加环境变量</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-%E5%88%9B%E5%BB%BA%E5%B7%A5%E7%A8%8B"><span class="nav-text">2. 创建工程</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#3-%E4%BF%AE%E6%94%B9%E4%BB%A3%E7%A0%81"><span class="nav-text">3. 修改代码</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#3-1-helloworld-tc825x-c"><span class="nav-text">3.1 helloworld_tc825x.c</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3-2-makefile%E6%96%87%E4%BB%B6"><span class="nav-text">3.2 makefile文件</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#4-%E7%BC%96%E8%AF%91%E5%B7%A5%E7%A8%8B"><span class="nav-text">4. 编译工程</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#5-%E6%88%90%E6%9E%9C%E7%89%A9%E5%9C%A8%E5%93%AA%EF%BC%9F"><span class="nav-text">5. 成果物在哪？</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E4%B8%89%E3%80%81%E7%83%A7%E5%86%99%E7%A8%8B%E5%BA%8F"><span class="nav-text">三、烧写程序</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1-%E7%A1%AC%E4%BB%B6%E8%BF%9E%E6%8E%A5"><span class="nav-text">1. 硬件连接</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-%E7%83%A7%E5%86%99%E8%BD%AF%E4%BB%B6%E4%BD%BF%E7%94%A8%E6%96%B9%E5%BC%8F"><span class="nav-text">2. 烧写软件使用方式</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#2-1-%E9%80%89%E6%8B%A9%E8%8A%AF%E7%89%87%E5%9E%8B%E5%8F%B7"><span class="nav-text">2.1 选择芯片型号</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2-2-%E6%93%A6%E9%99%A4flash"><span class="nav-text">2.2 擦除flash</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2-3-%E7%83%A7%E5%86%99%E5%8F%AF%E6%89%A7%E8%A1%8C%E6%96%87%E4%BB%B6"><span class="nav-text">2.3 烧写可执行文件</span></a></li></ol></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E5%9B%9B%E3%80%81%E9%87%8D%E5%90%AF%E6%B5%8B%E8%AF%95"><span class="nav-text">四、重启测试</span></a></li></ol></div>
        </div>
        <!--/noindex-->

        <div class="site-overview-wrap sidebar-panel">
          <div class="site-author animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="苏木"
      src="/images/avatar.jpg">
  <p class="site-author-name" itemprop="name">苏木</p>
  <div class="site-description" itemprop="description">莫道桑榆晚，为霞尚满天</div>
</div>
<div class="site-state-wrap animated">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
        <a href="/archives/">
          <span class="site-state-item-count">673</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
          <a href="/categories/">
        <span class="site-state-item-count">42</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
        <span class="site-state-item-count">43</span>
        <span class="site-state-item-name">标签</span>
      </div>
  </nav>
</div>
  <div class="links-of-author animated">
      <span class="links-of-author-item">
        <a href="https://github.com/sumumm" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;sumumm" rel="noopener me" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a>
      </span>
  </div>

        </div>
      </div>
    </div>

    
  </aside>


    </div>

    <div class="main-inner post posts-expand">


  


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://sumumm.github.io/post/e0ca430.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.jpg">
      <meta itemprop="name" content="苏木">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="苏木">
      <meta itemprop="description" content="莫道桑榆晚，为霞尚满天">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="LV03-04-天猫蓝牙Mesh开发-01-环境搭建 | 苏木">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          LV03-04-天猫蓝牙Mesh开发-01-环境搭建
        </h1>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2024-01-07 11:45:35" itemprop="dateCreated datePublished" datetime="2024-01-07T11:45:35+08:00">2024-01-07</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/" itemprop="url" rel="index"><span itemprop="name">嵌入式开发</span></a>
        </span>
          ，
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/" itemprop="url" rel="index"><span itemprop="name">01HQ课程体系</span></a>
        </span>
          ，
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/" itemprop="url" rel="index"><span itemprop="name">LV21-天猫精灵IOT</span></a>
        </span>
    </span>

  
    <span class="post-meta-break"></span>
    <span class="post-meta-item" title="本文字数">
      <span class="post-meta-item-icon">
        <i class="far fa-file-word"></i>
      </span>
      <span class="post-meta-item-text">本文字数：</span>
      <span>10k</span>
    </span>
    <span class="post-meta-item" title="阅读时长">
      <span class="post-meta-item-icon">
        <i class="far fa-clock"></i>
      </span>
      <span class="post-meta-item-text">阅读时长 &asymp;</span>
      <span>38 分钟</span>
    </span>
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody"><p>本文主要是天猫蓝牙Mesh开发——环境搭建的相关笔记，若笔记中有错误或者不合适的地方，欢迎批评指正😃。</p>
<span id="more"></span>

<!-- Photo: https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/ -->

<details class="folding-tag" blue><summary> 点击查看使用工具及版本 </summary>
              <div class='content'>
              <table>    <tr>        <td align="center" width=150px>Windows版本</td>        <td align="left">windows11</td>    </tr>    <tr>        <td align="center">Ubuntu版本</td>        <td align="left">Ubuntu22.04的64位版本</td>      </tr>    <tr>        <td align="center">VMware® Workstation 16 Pro</td>        <td align="left">16.2.3 build-19376536</td>      </tr>    <tr>        <td align="center">终端软件</td>        <td align="left">MobaXterm(Professional Edition v23.0 Build 5042 (license))</td>      </tr></table>
              </div>
            </details>

<details class="folding-tag" blue><summary> 点击查看本文参考资料 </summary>
              <div class='content'>
              <table>    <tr>        <td align="center">分类</td>        <td align="center">网址</td>        <td align="center">说明</td>    </tr>    <tr>        <td align="center" rowspan="6">官方网站</td>        <td align="left"><a href="https://cn.aliyun.com/" target="_blank">阿里云</a></td>        <td align="left">阿里云官网主页</td>    </tr>    <tr>        <td align="left"><a href="https://www.aliyun.com/product/iot/livinglink?spm=5176.28508143.J_4VYgf18xNlTAyFFbOuOQe.317.5421154acZniIL&scm=20140722.X_data-1da961ea118f5bb0e4b2._.V_1" target="_blank">阿里生活物联平台</a></td>        <td align="left">生活物联网平台(飞燕平台)主页</td>    </tr>    <tr>        <td align="left"><a href="https://iap.aligenie.com/?spm=0.7629140.0.0.2c611780Ty6tzg" target="_blank">AliGenie</a></td>        <td align="left">天猫精灵开放平台AliGenie主页</td>    </tr>    <tr>        <td align="left"><a href="https://www.aliyun.com/product/iot/iot_instc_public_cn?spm=5176.28508143.J_4VYgf18xNlTAyFFbOuOQe.81.5421154au3ocqp&scm=20140722.X_data-9349178ba84cf028806a._.V_1" target="_blank">阿里物联网平台</a></td>        <td align="left">阿里物联网平台主页</td>    </tr>    <tr>        <td align="left"><a href="https://www.bluetooth.com/zh-cn/" target="_blank">Bluetooth 技术网站</a></td>        <td align="left">蓝牙协议规范什么的可以来这里找</td>    </tr>    <tr>        <td align="left"><a href="https://www.telink-semi.com/" target="_blank">Telink</a></td>        <td align="left">Telink | Chips for a Smarter IoT (telink-semi.com)<br><a href="https://www.telink-semi.cn/" target="_blank">Telink中文官网</a></td>    </tr>    <tr>        <td align="center" rowspan="5">开发手册</td>        <td align="left"><a href="https://help.aliyun.com/zh/alios-things/" target="_blank">AliOS Things开发指南</a></td>        <td align="left">AliOS Things开发指南，这里是最新版本，可以直接从官网找到</td>    </tr>     <tr>        <td align="left"><a href="https://haas.iot.aliyun.com/aliosthings/index.html" target="_blank">AliOS Things开发指南</a></td>        <td align="left">AliOS Things应用开发指南，这里应该是3.3版本的完整开发文档</td>    </tr>    <tr>        <td align="left"><a href="https://gaic.alicdn.com/aic/h5_daily/test/aliosthings/3.0.13/index.html" target="_blank">AliOS Things开发指南(3.0)</a></td>        <td align="left">AliOS Things应用开发指南，这里应该是3.0版本的完整开发文档</td>    </tr>    <tr>        <td align="left"><a href="https://help.aliyun.com/product/123207.html?spm=a2c4g.11186623.6.540.114e60d84sF58G" target="_blank">生活物联网平台开发文档</a></td>        <td align="left">生活物联网平台（飞燕平台）开发文档<br><a href="https://help.aliyun.com/document_detail/180778.html?spm=a2c4g.123207.0.0.49556adcO5apvd" target="_blank">《设备端开发指南》</a></td>    </tr>    <tr>        <td align="left"><a href="https://doc-bot.tmall.com/docs/doc.htm?spm=0.7629140.0.0.7bf81780UN7WkQ&treeId=578&articleId=118057&docType=1" target="_blank">Wi-Fi IoT品类定义与功能开发</a></td>        <td align="left">天猫精灵IoT开放平台——Wi-Fi IoT品类定义与功能开发</td>    </tr>    <tr>        <td align="center" rowspan="3">硬件平台</td>        <td align="left"><a href="https://developer.aliyun.com/article/761644?spm=a2c6h.12873581.0.dArticle761644.1c1b589dRHgvcR&groupCode=genieaiot" target="_blank">mk3080 WiFi开发板</a></td>        <td align="left">WiFi开发板使用指南-阿里云开发者社区</td>    </tr>    <tr>        <td align="left"><a href="http://www.taichi-maker.com/homepage/esp8266-nodemcu-iot/esp8266-nodemcu-tutorial-index/" target="_blank">esp8266开发板</a></td>        <td align="left">一个教程：ESP8266-NodeMCU开发板详解-太极创客 (taichi-maker.com)</td>    </tr>    <tr>        <td align="left"><a href="https://wiki.telink-semi.cn/doc/ds/DS_TLSR8258-E_Datasheet%20for%20Telink%20BLE+IEEE802.15.4%20Multi-Standard%20Wireless%20SoC%20TLSR8258.pdf" target="_blank">TLSR8258 Datasheet</a></td>        <td align="left">Datasheet for Telink BLE + IEEE802.15.4 MultiStandard Wireless SoC TLSR8258</td>    </tr>    <tr>        <td align="center" rowspan="2">参考资料</td>        <td align="left"><a href="https://developer.aliyun.com/article/720516#" target="_blank">AliOS Things 3.0 应用开发指南</a></td>        <td align="left">这个只是一篇参考文章，里面是一些环境搭建相关的，可以参考</td>    </tr>    <tr>        <td align="left"><a href="https://info.support.huawei.com/info-finder/encyclopedia/zh/index.html" target="_blank">IP知识百科 - 华为 (huawei.com)</a></td>        <td align="left">IP的一些相关知识点</td>    </tr></table>
              </div>
            </details>

<details class="folding-tag" blue><summary> 点击查看相关文件下载 </summary>
              <div class='content'>
              <table>    <tr>        <td align="center" width=150px>分类</td>        <td align="center">网址</td>        <td align="center">说明</td>    </tr>    <tr>        <td align="left" rowspan="6">蓝牙规范相关文档</td>        <td align="left"><a href="https://www.bluetooth.com/zh-cn/specifications/specs/core-specification-5-2/" target="_blank">Core Specification 5.2</a></td>        <td align="left">核心规格 5.2，该规范定义了创建可互操作的Bluetooth 设备所需的技术。                        <br><a href="./蓝牙参考资料/Core_v5.2.pdf" target="_blank">《Core_v5.2.pdf》</a></td>      </tr>    <tr>        <td align="left"><a href="https://www.bluetooth.com/zh-cn/specifications/specs/mesh-model-1-1/" target="_blank">Mesh Model(v1.1)</a></td>        <td align="left">本Bluetooth 规范定义了模型（以及它们所需的状态和消息），这些模型用于在mesh 网络中的节点上执行基本功能，超出了Bluetooth Mesh 配置文件 规范中定义的基础模型。                        <br>本规范包括定义跨设备类型标准功能的通用模型，以及支持关键mesh 场景的模型，如照明控制、传感器、时间和场景。                        <br><a href="./蓝牙参考资料/MshMDL_v1.1.pdf" target="_blank">《MshMDL_v1.1.pdf》</a></td>      </tr>    <tr>        <td align="left"><a href="https://www.bluetooth.com/zh-cn/specifications/specs/mesh-profile-1-0-1/" target="_blank">Mesh Profile(v1.0.1)</a></td>        <td align="left">该Bluetooth 规范定义了基本要求，以实现可互操作的mesh 网络解决方案，用于Bluetooth 低能量无线技术。                        <br><a href="./蓝牙参考资料/MshPRFv1.0.1.pdf" target="_blank">《MshPRFv1.0.1.pdf》</a></td>      </tr>    <tr>        <td align="left"><a href="https://www.bluetooth.com/zh-cn/specifications/device-properties/" target="_blank">Mesh Device Properties</a></td>        <td align="left">本规范包含Bluetooth Mesh 配置文件 和Bluetooth Mesh 模型规范所要求的设备属性的定义。                        <br>但是跟之前的有些区别，我主要看的之前的版本：<a href="./蓝牙参考资料/MeshDeviceProperties_v1.2.pdf" target="_blank">《MMeshDeviceProperties_v1.2.pdf》</a></td>      </tr>    <tr>        <td align="left"><a href="https://www.bluetooth.com/specifications/gss/" target="_blank">GATT Specification Supplement</a></td>        <td align="left">GATT Specification Supplement | Bluetooth® Technology Website。                        <br>好像可以在线看：<a href="https://btprodspecificationrefs.blob.core.windows.net/gatt-specification-supplement/GATT_Specification_Supplement.pdf" target="_blank">《GATT Specification Supplement》</a></td>      </tr>     <tr>        <td align="left"><a href="https://www.bluetooth.com/specifications/assigned-numbers/" target="_blank">Assigned Numbers</a></td>        <td align="left">GATT的一些类型定义可以在这里找。</td>      </tr>    <tr>        <td align="left" rowspan="2">AliOS Things</td>        <td align="left"><a href="https://gitee.com/alios-things-admin/AliOS-Things" target="_blank">alios-things/AliOS-Things</a></td>        <td align="left">Gitee上的AliOSThings SDK源码仓库</td>      </tr>    <tr>        <td align="left"><a href="https://github.com/alibaba/AliOS-Things" target="_blank">alibaba/AliOS-Things</a></td>        <td align="left">GitHub上的AliOSThings SDK源码仓库</td>      </tr>    <tr>        <td align="left" rowspan="2">天猫精灵蓝牙Mesh协议栈</td>        <td align="left"><a href="https://github.com/alibaba-archive/genie-bt-mesh-stack" target="_blank">alibaba-archive/genie-bt-mesh-stack</a></td>        <td align="left">GitHub上的天猫精灵蓝牙Mesh协议栈源码仓库。<br>之前是在<a href="https://github.com/alibaba/genie-bt-mesh-stack"target="_blank">alibaba/genie-bt-mesh-stack</a>这个仓库。<br>写笔记的时候最新提交为<a href="https://github.com/alibaba-archive/genie-bt-mesh-stack/tree/faf523618a6a2560090fc423222b9db80984bb7a" target="_blank">faf523618a6a2560090fc423222b9db80984bb7a</a></td>      </tr>    <tr>        <td align="left"><a href="https://help.aliyun.com/document_detail/171552.html?spm=a2c4g.173310.0.0.55d6e992e8xJip" target="_blank">蓝牙Mesh设备开发指南</a></td>        <td align="left">阿里云生活服务平台开发手册——蓝牙设备开发一节中的内容</td>      </tr></table>
              </div>
            </details>


<h1 id="一、开发环境搭建"><a href="#一、开发环境搭建" class="headerlink" title="一、开发环境搭建"></a><font size=3>一、开发环境搭建</font></h1><h2 id="1-硬件设备"><a href="#1-硬件设备" class="headerlink" title="1. 硬件设备"></a><font size=3>1. 硬件设备</font></h2><h3 id="1-1-有哪些？"><a href="#1-1-有哪些？" class="headerlink" title="1.1 有哪些？"></a><font size=3>1.1 有哪些？</font></h3><p>硬件：泰凌蓝牙tc825x、方糖、Telink下载器、数据线、杜邦线、直流电机、DS18B20 等，但不一定全部都会用。</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224134919434.png" alt="image-20231224134919434" style="zoom:50%;" />



<p>我们的开发箱中，除了mk3080模块，还有三个蓝牙模块和一个下载器，正面图片如下所示，最左侧的就是上面说的仿真器，右侧三个是蓝牙开发板，蓝牙开发板使用的是泰凌微8258模块。</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224135514491.png" alt="image-20231224135514491" style="zoom:50%;" />

<p>背面如下图所示，蓝牙模块的背面的丝印表示了引脚的编号：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224135715616.png" alt="image-20231224135715616" style="zoom:50%;" />

<h3 id="1-2-泰凌微8258模块简介"><a href="#1-2-泰凌微8258模块简介" class="headerlink" title="1.2 泰凌微8258模块简介"></a><font size=3>1.2 泰凌微8258模块简介</font></h3><p>Telink新一代TLSR825x系列在ISM 2.4GHz频段提供了最先进的超低功耗(ULP)并发多协议物联网解决方案。它支持蓝牙 LE, Telink专有和蓝牙Mesh, Zigbee, RF4CE, HomeKit和2.4GHz专有。</p>
<p>TLSR825x是围绕一个32位MCU构建的，运行频率高达48MHz。它具有14位ADC，具有PGA, AMIC, DMIC，立体声音频输出，6通道PWM，一个正交解码器(QDEC)和灵活的GPIO接口。</p>
<p>相关资料可以来这里找：<a target="_blank" rel="noopener" href="https://wiki.telink-semi.cn/wiki/chip-series/TLSR825x-Series/">TLSR825x Series - Telink wiki (telink-semi.cn)</a></p>
<h2 id="2-软件与SDK"><a href="#2-软件与SDK" class="headerlink" title="2. 软件与SDK"></a><font size=3>2. 软件与SDK</font></h2><h3 id="2-1-蓝牙Mesh协议栈"><a href="#2-1-蓝牙Mesh协议栈" class="headerlink" title="2.1 蓝牙Mesh协议栈"></a><font size=3>2.1 蓝牙Mesh协议栈</font></h3><p>我们使用的天猫精灵蓝牙Mesh协议栈是1.1.1版本（<a target="_blank" rel="noopener" href="https://github.com/alibaba-archive/genie-bt-mesh-stack/tree/faf523618a6a2560090fc423222b9db80984bb7a">alibaba-archive&#x2F;genie-bt-mesh-stack at faf523618a6a2560090fc423222b9db80984bb7a (github.com)</a>），我们可以在这里下载：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git clone git@github.com:alibaba-archive/genie-bt-mesh-stack.git</span><br></pre></td></tr></table></figure>

<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224140124639.png" alt="image-20231224140124639" />

<p>下载完成后可以看到有如下文件（下图是在linux中下载的，但是后来发现，这个蓝牙Mesh不支持在linux下开发，只支持windows）：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224140205917.png" alt="image-20231224140205917" style="zoom:50%;" />

<p>我们可以在windows下下载源码，我放在这里：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">D:\MyLinux\genie-bt-mesh\genie-bt-mesh-stack</span><br></pre></td></tr></table></figure>

<h3 id="2-2-Telink程序下载器-免驱"><a href="#2-2-Telink程序下载器-免驱" class="headerlink" title="2.2 Telink程序下载器(免驱)  "></a><font size=3>2.2 Telink程序下载器(免驱)  </font></h3><p>我们在window下进行程序烧录，需要安装一个烧录软件，我们可以去官网下载：<a target="_blank" rel="noopener" href="https://www.telink-semi.cn/for-developers/">Telink | Developer Resources (telink-semi.cn)</a></p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224141856681.png" alt="image-20231224141856681" />

<p>之前出到TLSR8系列的时候是这样的：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224141919765.png" alt="image-20231224141919765" style="zoom:50%;" />

<p>现在我们选择上面的全系列（<a target="_blank" rel="noopener" href="https://wiki.telink-semi.cn/wiki/IDE-and-Tools/Burning-and-Debugging-Tools-for-all-Series/">Burning and Debugging Tools for all Series - Telink wiki (telink-semi.cn)</a>）即可：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224142008391.png" alt="image-20231224142008391" />

<p>我们点击开始下载，下载完成后会得到这样一个压缩包文件：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224142052356.png" alt="image-20231224142052356" />

<p>我们解压后可以得到可执行文件，这个是免安装的：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224142121017.png" alt="image-20231224142121017" style="zoom:50%;" />

<p>我们直接双击打开，界面如下：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224142201704.png" alt="image-20231224142201704" />

<p>后面会说明软件如何使用。</p>
<h3 id="2-3-VScode相关"><a href="#2-3-VScode相关" class="headerlink" title="2.3 VScode相关"></a><font size=3>2.3 VScode相关</font></h3><h4 id="2-3-1-vscode编辑器安装"><a href="#2-3-1-vscode编辑器安装" class="headerlink" title="2.3.1 vscode编辑器安装"></a><font size=3>2.3.1 vscode编辑器安装</font></h4><p>这个就很简单了，经常用。但是这仅仅是一个编辑器，后续我们还要再安装一些插件。</p>
<h4 id="2-3-2-vscode插件安装"><a href="#2-3-2-vscode插件安装" class="headerlink" title="2.3.2 vscode插件安装"></a><font size=3>2.3.2 vscode插件安装</font></h4><p>我们需要安装这个插件：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224145837573.png" alt="image-20231224145837573"  />

<p>但是很遗憾，在2023年12月24的时候，这个插件找不到了，实际上就是官网提供了其他的插件（<a target="_blank" rel="noopener" href="https://help.aliyun.com/zh/alios-things/developer-reference/set-up-the-development-environment?spm=a2c4g.11186623.0.i7">如何通过VisualStudioCode搭建开发环境_物联网终端操作系统(AliOS Things)-阿里云帮助中心 (aliyun.com)</a>）：</p>
<p><img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224150021454.png" alt="image-20231224150021454"></p>
<p>那我们就安装这个好了。安装过程中，这里会有一些提示信息：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224150123010.png" alt="image-20231224150123010" />

<p>我们要注意是否提示安装一些依赖，需要的时候进行安装即可。安装完毕后，会有以下提示信息：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224150238722.png" alt="image-20231224150238722" />

<p>但是这里还是有坑，这里很显然说安装了aos-tools，那么aos命令应该是可用的，但是实际安装完之后找不到命令，我也没找到安装的位置，所以就只能使用pip安装aos-cube啦。这里的插件就可以卸载掉了，但是一开始的时候就没安装，但是后面使用python出现问题，也可以安装一下，因为它里面会为我们安装很多的插件，包含python。</p>
<h3 id="2-4-pip安装aos"><a href="#2-4-pip安装aos" class="headerlink" title="2.4 pip安装aos"></a><font size=3>2.4 pip安装aos</font></h3><h4 id="2-4-1-更新pip"><a href="#2-4-1-更新pip" class="headerlink" title="2.4.1 更新pip"></a><font size=3>2.4.1 更新pip</font></h4><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">python -m pip install --upgrade pip</span><br></pre></td></tr></table></figure>

<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224155946202.png" alt="image-20231224155946202" />

<h4 id="2-4-2-安装setuptools"><a href="#2-4-2-安装setuptools" class="headerlink" title="2.4.2 安装setuptools"></a><font size=3>2.4.2 安装setuptools</font></h4><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">python -m pip install setuptools</span><br></pre></td></tr></table></figure>

<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224155745597.png" alt="image-20231224155745597" />

<h4 id="2-4-3-安装wheels"><a href="#2-4-3-安装wheels" class="headerlink" title="2.4.3 安装wheels"></a><font size=3>2.4.3 安装wheels</font></h4><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">python -m pip install wheel</span><br></pre></td></tr></table></figure>

<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224155816360.png" alt="image-20231224155816360" />

<h4 id="2-4-4-安装aos-cube"><a href="#2-4-4-安装aos-cube" class="headerlink" title="2.4.4 安装aos-cube"></a><font size=3>2.4.4 安装aos-cube</font></h4><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">python -m pip install aos-cube</span><br></pre></td></tr></table></figure>

<p>这个安装过程会有以下打印信息：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br></pre></td><td class="code"><pre><span class="line">20380@qidaink MINGW64 /d/MyLinux/genie-bt-mesh/test_demo</span><br><span class="line"><span class="meta prompt_">$ </span><span class="language-bash">python -m pip install aos-cube</span></span><br><span class="line">Collecting aos-cube</span><br><span class="line">  Downloading aos-cube-0.5.11.tar.gz (52 kB)</span><br><span class="line">     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 52.6/52.6 kB 246.2 kB/s eta 0:00:00</span><br><span class="line">  Preparing metadata (setup.py) ... done</span><br><span class="line">Collecting pyserial (from aos-cube)</span><br><span class="line">  Downloading pyserial-3.5-py2.py3-none-any.whl (90 kB)</span><br><span class="line">     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 90.6/90.6 kB 68.6 kB/s eta 0:00:00</span><br><span class="line">Collecting esptool (from aos-cube)</span><br><span class="line">  Downloading esptool-4.7.0.tar.gz (285 kB)</span><br><span class="line">     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 285.5/285.5 kB 22.5 kB/s eta 0:00:00</span><br><span class="line">  Preparing metadata (setup.py) ... done</span><br><span class="line">Collecting scons (from aos-cube)</span><br><span class="line">  Downloading SCons-4.6.0-py3-none-any.whl.metadata (9.0 kB)</span><br><span class="line">Requirement already satisfied: requests in c:\lenovosoft\python310\lib\site-packages (from aos-cube) (2.27.1)</span><br><span class="line">Collecting click (from aos-cube)</span><br><span class="line">  Downloading click-8.1.7-py3-none-any.whl.metadata (3.0 kB)</span><br><span class="line">Collecting paho-mqtt (from aos-cube)</span><br><span class="line">  Downloading paho-mqtt-1.6.1.tar.gz (99 kB)</span><br><span class="line">     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 99.4/99.4 kB 18.5 kB/s eta 0:00:00</span><br><span class="line">  Preparing metadata (setup.py) ... done</span><br><span class="line">Collecting progressbar2 (from aos-cube)</span><br><span class="line">  Downloading progressbar2-4.3.2-py3-none-any.whl.metadata (16 kB)</span><br><span class="line">Collecting configparser (from aos-cube)</span><br><span class="line">  Downloading configparser-6.0.0-py3-none-any.whl.metadata (11 kB)</span><br><span class="line">Collecting colorama (from click-&gt;aos-cube)</span><br><span class="line">  Downloading colorama-0.4.6-py2.py3-none-any.whl (25 kB)</span><br><span class="line">Collecting bitstring&gt;=3.1.6 (from esptool-&gt;aos-cube)</span><br><span class="line">  Downloading bitstring-4.1.4-py3-none-any.whl.metadata (5.8 kB)</span><br><span class="line">Requirement already satisfied: cryptography&gt;=2.1.4 in c:\lenovosoft\python310\lib\site-packages (from esptool-&gt;aos-cube) (36.0.1)</span><br><span class="line">Collecting ecdsa&gt;=0.16.0 (from esptool-&gt;aos-cube)</span><br><span class="line">  Downloading ecdsa-0.18.0-py2.py3-none-any.whl (142 kB)</span><br><span class="line">     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 142.9/142.9 kB 19.1 kB/s eta 0:00:00</span><br><span class="line">Collecting reedsolo&lt;1.8,&gt;=1.5.3 (from esptool-&gt;aos-cube)</span><br><span class="line">  Downloading reedsolo-1.7.0-py3-none-any.whl (32 kB)</span><br><span class="line">Collecting PyYAML&gt;=5.1 (from esptool-&gt;aos-cube)</span><br><span class="line">  Downloading PyYAML-6.0.1-cp310-cp310-win_amd64.whl.metadata (2.1 kB)</span><br><span class="line">Collecting intelhex (from esptool-&gt;aos-cube)</span><br><span class="line">  Downloading intelhex-2.3.0-py2.py3-none-any.whl (50 kB)</span><br><span class="line">     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 50.9/50.9 kB 17.6 kB/s eta 0:00:00</span><br><span class="line">Collecting python-utils&gt;=3.8.1 (from progressbar2-&gt;aos-cube)</span><br><span class="line">  Downloading python_utils-3.8.1-py2.py3-none-any.whl.metadata (9.7 kB)</span><br><span class="line">Requirement already satisfied: urllib3&lt;1.27,&gt;=1.21.1 in c:\lenovosoft\python310\lib\site-packages (from requests-&gt;aos-cube) (1.26.8)</span><br><span class="line">Requirement already satisfied: certifi&gt;=2017.4.17 in c:\lenovosoft\python310\lib\site-packages (from requests-&gt;aos-cube) (2021.10.8)</span><br><span class="line">Requirement already satisfied: charset-normalizer~=2.0.0 in c:\lenovosoft\python310\lib\site-packages (from requests-&gt;aos-cube) (2.0.12)</span><br><span class="line">Requirement already satisfied: idna&lt;4,&gt;=2.5 in c:\lenovosoft\python310\lib\site-packages (from requests-&gt;aos-cube) (3.3)</span><br><span class="line">Requirement already satisfied: setuptools in c:\lenovosoft\python310\lib\site-packages (from scons-&gt;aos-cube) (58.1.0)</span><br><span class="line">Collecting bitarray&lt;3.0.0,&gt;=2.8.0 (from bitstring&gt;=3.1.6-&gt;esptool-&gt;aos-cube)</span><br><span class="line">  Downloading bitarray-2.9.1-cp310-cp310-win_amd64.whl.metadata (35 kB)</span><br><span class="line">Requirement already satisfied: cffi&gt;=1.12 in c:\lenovosoft\python310\lib\site-packages (from cryptography&gt;=2.1.4-&gt;esptool-&gt;aos-cube) (1.15.0)</span><br><span class="line">Requirement already satisfied: six&gt;=1.9.0 in c:\lenovosoft\python310\lib\site-packages (from ecdsa&gt;=0.16.0-&gt;esptool-&gt;aos-cube) (1.16.0)</span><br><span class="line">Requirement already satisfied: typing-extensions&gt;3.10.0.2 in c:\lenovosoft\python310\lib\site-packages (from python-utils&gt;=3.8.1-&gt;progressbar2-&gt;aos-cube) (4.1.1)</span><br><span class="line">Requirement already satisfied: pycparser in c:\lenovosoft\python310\lib\site-packages (from cffi&gt;=1.12-&gt;cryptography&gt;=2.1.4-&gt;esptool-&gt;aos-cube) (2.21)</span><br><span class="line">Downloading click-8.1.7-py3-none-any.whl (97 kB)</span><br><span class="line">   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 97.9/97.9 kB 19.0 kB/s eta 0:00:00</span><br><span class="line">Downloading configparser-6.0.0-py3-none-any.whl (19 kB)</span><br><span class="line">Downloading progressbar2-4.3.2-py3-none-any.whl (50 kB)</span><br><span class="line">   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 50.6/50.6 kB 10.2 kB/s eta 0:00:00</span><br><span class="line">Downloading SCons-4.6.0-py3-none-any.whl (4.3 MB)</span><br><span class="line">   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.3/4.3 MB 14.5 kB/s eta 0:00:00</span><br><span class="line">Downloading bitstring-4.1.4-py3-none-any.whl (60 kB)</span><br><span class="line">   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.0/61.0 kB 15.0 kB/s eta 0:00:00</span><br><span class="line">Downloading python_utils-3.8.1-py2.py3-none-any.whl (27 kB)</span><br><span class="line">Downloading PyYAML-6.0.1-cp310-cp310-win_amd64.whl (145 kB)</span><br><span class="line">   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 145.3/145.3 kB 20.0 kB/s eta 0:00:00</span><br><span class="line">Downloading bitarray-2.9.1-cp310-cp310-win_amd64.whl (126 kB)</span><br><span class="line">   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 126.0/126.0 kB 15.3 kB/s eta 0:00:00</span><br><span class="line">Building wheels for collected packages: aos-cube, esptool, paho-mqtt</span><br><span class="line">  Building wheel for aos-cube (setup.py) ... done</span><br><span class="line">  Created wheel for aos-cube: filename=aos_cube-0.5.11-py3-none-any.whl size=67170 sha256=93546743024fa246150ae485a326e2897f4cb4314dfbfd5e61fbef41808e4af1</span><br><span class="line">  Stored in directory: c:\users\20380\appdata\local\pip\cache\wheels\46\20\12\aad44def045b0e2e4a63c8214e611f6800e6513de0f330be36</span><br><span class="line">  Building wheel for esptool (setup.py) ... done</span><br><span class="line">  Created wheel for esptool: filename=esptool-4.7.0-py3-none-any.whl size=364555 sha256=70171bc79f150fdd81da2e561b06ab8cf8bbded4558b174f748b97fcc78e8065</span><br><span class="line">  Stored in directory: c:\users\20380\appdata\local\pip\cache\wheels\cb\35\1f\46fb9edf0a94ac86c24999d7b45de825925f425d197a18799d</span><br><span class="line">  Building wheel for paho-mqtt (setup.py) ... done</span><br><span class="line">  Created wheel for paho-mqtt: filename=paho_mqtt-1.6.1-py3-none-any.whl size=65666 sha256=97b5e61f44a97b1a91dda40bae6d1fe1e5e6af57ddce43c37c305d5fa02ce40b</span><br><span class="line">  Stored in directory: c:\users\20380\appdata\local\pip\cache\wheels\8b\bb\0c\79444d1dee20324d442856979b5b519b48828b0bd3d05df84a</span><br><span class="line">Successfully built aos-cube esptool paho-mqtt</span><br><span class="line">Installing collected packages: reedsolo, pyserial, paho-mqtt, intelhex, bitarray, scons, PyYAML, python-utils, ecdsa, configparser, colorama, bitstring, progressbar2, click, esptool, aos-cube</span><br><span class="line">Successfully installed PyYAML-6.0.1 aos-cube-0.5.11 bitarray-2.9.1 bitstring-4.1.4 click-8.1.7 colorama-0.4.6 configparser-6.0.0 ecdsa-0.18.0 esptool-4.7.0 intelhex-2.3.0 paho-mqtt-1.6.1 progressbar2-4.3.2 pyserial-3.5 python-utils-3.8.1 reedsolo-1.7.0 scons-4.6.0</span><br></pre></td></tr></table></figure>

<p>验证是否安装成功：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">aos</span><br></pre></td></tr></table></figure>

<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224160133543.png" alt="image-20231224160133543" />

<p>我们从这里输入Y，会接着有以下打印信息：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224160202108.png" alt="image-20231224160202108" />

<p>这就表明我们的aos可以使用啦。</p>
<h2 id="3-环境配置"><a href="#3-环境配置" class="headerlink" title="3. 环境配置"></a><font size=3>3. 环境配置</font></h2><h3 id="3-1-为什么不用linux？"><a href="#3-1-为什么不用linux？" class="headerlink" title="3.1 为什么不用linux？"></a><font size=3>3.1 为什么不用linux？</font></h3><p>很简单，不支持呗，我属于那种比较犟的，非要一试，像当时在linux中开发AliOSThings一样，安装好ptyhon，aos相关工具，然后我们输入以下命令编译一下：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">aos make bluetooth.helloworld@tc825x</span><br></pre></td></tr></table></figure>

<p>果不其然，报错啦：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224143536122.png" alt="image-20231224143536122" />

<p>原因是啥？很显然，是因为找不到这个.exe文件，这是window下的可执行文件，在linux中怎么可能支持嘛，所以还是老老实实跟着课程在windows下开发啦。</p>
<h3 id="3-2-创建vscode工程"><a href="#3-2-创建vscode工程" class="headerlink" title="3.2 创建vscode工程"></a><font size=3>3.2 创建vscode工程</font></h3><p>我们这里进行一个工程创建，默认的工程文件如下图所示：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224150831920.png" alt="image-20231224150831920" />

<h3 id="3-3-创建-vscode目录"><a href="#3-3-创建-vscode目录" class="headerlink" title="3.3 创建.vscode目录"></a><font size=3>3.3 创建.vscode目录</font></h3><p>我们再新建一个.vscode文件夹用来存放配置文件：  </p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224151103163.png" alt="image-20231224151103163" />

<h3 id="3-4-可视和搜索配置"><a href="#3-4-可视和搜索配置" class="headerlink" title="3.4 可视和搜索配置"></a><font size=3>3.4 可视和搜索配置</font></h3><p>然后我们找一下settings.json文件，看一下文件格式：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224151035182.png" alt="image-20231224151035182"  />

<p>然后我们在.vscode目录中新建此文件：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224151326972.png" alt="image-20231224151326972" />

<p>在里面添加如下内容：</p>
<figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><span class="line"><span class="punctuation">&#123;</span></span><br><span class="line">    <span class="attr">&quot;search.exclude&quot;</span><span class="punctuation">:</span> <span class="punctuation">&#123;</span> <span class="comment">//表示搜索区域</span></span><br><span class="line">        <span class="attr">&quot;**/platform/mcu/[a-s]*&quot;</span> <span class="punctuation">:</span> <span class="literal"><span class="keyword">true</span></span><span class="punctuation">,</span> <span class="comment">//[a-s]* 表示a到s字符开头的全部屏蔽，数值也一样，自行体验</span></span><br><span class="line">        <span class="attr">&quot;**/board/bk3435devkit&quot;</span> <span class="punctuation">:</span> <span class="literal"><span class="keyword">true</span></span><span class="punctuation">,</span></span><br><span class="line">        <span class="attr">&quot;**/board/pca10040&quot;</span> <span class="punctuation">:</span> <span class="literal"><span class="keyword">true</span></span><span class="punctuation">,</span></span><br><span class="line">        <span class="attr">&quot;**/board/ch6121evb&quot;</span> <span class="punctuation">:</span> <span class="literal"><span class="keyword">true</span></span><span class="punctuation">,</span></span><br><span class="line">        <span class="attr">&quot;**/board/tg7100b&quot;</span> <span class="punctuation">:</span> <span class="literal"><span class="keyword">true</span></span><span class="punctuation">,</span></span><br><span class="line">    <span class="punctuation">&#125;</span><span class="punctuation">,</span></span><br><span class="line">    <span class="attr">&quot;files.exclude&quot;</span><span class="punctuation">:</span><span class="punctuation">&#123;</span> <span class="comment">//表示显示区域</span></span><br><span class="line">        <span class="attr">&quot;**/.git&quot;</span> <span class="punctuation">:</span> <span class="literal"><span class="keyword">true</span></span><span class="punctuation">,</span> <span class="comment">//true标识改目录不被显示</span></span><br><span class="line">        <span class="attr">&quot;**/.g**&quot;</span> <span class="punctuation">:</span> <span class="literal"><span class="keyword">true</span></span><span class="punctuation">,</span> <span class="comment">//*号标识通配符，.g开头的均屏蔽，根据用途自行配置，多多尝试</span></span><br><span class="line">        <span class="attr">&quot;**/platform/mcu/[a-s]*&quot;</span> <span class="punctuation">:</span> <span class="literal"><span class="keyword">true</span></span><span class="punctuation">,</span> <span class="comment">//[a-s]* 表示a到s字符开头的全部屏蔽，数值也一样，自行体验</span></span><br><span class="line">        <span class="attr">&quot;**/board/bk3435devkit&quot;</span> <span class="punctuation">:</span> <span class="literal"><span class="keyword">true</span></span><span class="punctuation">,</span></span><br><span class="line">        <span class="attr">&quot;**/board/pca10040&quot;</span> <span class="punctuation">:</span> <span class="literal"><span class="keyword">true</span></span><span class="punctuation">,</span></span><br><span class="line">        <span class="attr">&quot;**/board/ch6121evb&quot;</span> <span class="punctuation">:</span> <span class="literal"><span class="keyword">true</span></span><span class="punctuation">,</span></span><br><span class="line">        <span class="attr">&quot;**/board/tg7100b&quot;</span> <span class="punctuation">:</span> <span class="literal"><span class="keyword">true</span></span><span class="punctuation">,</span></span><br><span class="line">    <span class="punctuation">&#125;</span></span><br><span class="line"><span class="punctuation">&#125;</span></span><br></pre></td></tr></table></figure>

<h3 id="3-5-配置编译任务"><a href="#3-5-配置编译任务" class="headerlink" title="3.5 配置编译任务"></a><font size=3>3.5 配置编译任务</font></h3><p>我们创建一个task.json文件：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224152142211.png" alt="image-20231224152142211" />

<p>然后输入以下内容：</p>
<figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br></pre></td><td class="code"><pre><span class="line"><span class="punctuation">&#123;</span></span><br><span class="line">	<span class="attr">&quot;version&quot;</span><span class="punctuation">:</span> <span class="string">&quot;2.0.0&quot;</span><span class="punctuation">,</span></span><br><span class="line">	<span class="attr">&quot;tasks&quot;</span><span class="punctuation">:</span> <span class="punctuation">[</span></span><br><span class="line">		<span class="punctuation">&#123;</span></span><br><span class="line">			<span class="attr">&quot;label&quot;</span><span class="punctuation">:</span> <span class="string">&quot;tc825x&quot;</span><span class="punctuation">,</span> <span class="comment">//标签，会在生成代码中显示出来此目标名</span></span><br><span class="line">			<span class="attr">&quot;type&quot;</span><span class="punctuation">:</span> <span class="string">&quot;shell&quot;</span><span class="punctuation">,</span>   <span class="comment">//类型为shell</span></span><br><span class="line">			<span class="attr">&quot;command&quot;</span><span class="punctuation">:</span> <span class="string">&quot;aos&quot;</span><span class="punctuation">,</span> <span class="comment">//此处配置命令，本初使用的alios，所以指定了aos，如果是直接make就指定make即可</span></span><br><span class="line">			<span class="attr">&quot;args&quot;</span><span class="punctuation">:</span> <span class="punctuation">[</span></span><br><span class="line">				<span class="string">&quot;make&quot;</span><span class="punctuation">,</span></span><br><span class="line">				<span class="string">&quot;bluetooth.light_ctl@tc825x&quot;</span><span class="punctuation">,</span> <span class="comment">//此处为命令跟的参数，也就是aos make bluetooth.light_ctl@tc825x</span></span><br><span class="line">			<span class="punctuation">]</span><span class="punctuation">,</span></span><br><span class="line">			<span class="attr">&quot;group&quot;</span><span class="punctuation">:</span> <span class="string">&quot;build&quot;</span><span class="punctuation">,</span> <span class="comment">//归属于build组下，编译目标类别内</span></span><br><span class="line">			<span class="attr">&quot;presentation&quot;</span><span class="punctuation">:</span> <span class="punctuation">&#123;</span></span><br><span class="line">				<span class="attr">&quot;reveal&quot;</span><span class="punctuation">:</span> <span class="string">&quot;silent&quot;</span> <span class="comment">// 此处为出现错误时才会进行输出</span></span><br><span class="line">			<span class="punctuation">&#125;</span><span class="punctuation">,</span></span><br><span class="line">			<span class="attr">&quot;problemMatcher&quot;</span><span class="punctuation">:</span> <span class="string">&quot;$msCompile&quot;</span> <span class="comment">// 此处为使用标准的MS编译器输出错误和警告等信息</span></span><br><span class="line">		<span class="punctuation">&#125;</span><span class="punctuation">,</span></span><br><span class="line">		<span class="comment">/*</span></span><br><span class="line"><span class="comment">		//使用时如果没有第二个目标，可将下面的内容删除，注意格式即可</span></span><br><span class="line"><span class="comment">		&#123;</span></span><br><span class="line"><span class="comment">			&quot;label&quot;: &quot;可以指定第二个标签&quot;,</span></span><br><span class="line"><span class="comment">			&quot;type&quot;: &quot;shell&quot;,</span></span><br><span class="line"><span class="comment">			&quot;command&quot;: &quot;我们的命令&quot;,</span></span><br><span class="line"><span class="comment">			&quot;args&quot;: [</span></span><br><span class="line"><span class="comment">				&quot;我们的参数&quot;,</span></span><br><span class="line"><span class="comment">			],</span></span><br><span class="line"><span class="comment">			&quot;group&quot;: &quot;build&quot;,</span></span><br><span class="line"><span class="comment">			&quot;presentation&quot;: &#123;</span></span><br><span class="line"><span class="comment">				&quot;reveal&quot;: &quot;silent&quot;</span></span><br><span class="line"><span class="comment">			&#125;,</span></span><br><span class="line"><span class="comment">			&quot;problemMatcher&quot;: &quot;$msCompile&quot;</span></span><br><span class="line"><span class="comment">		&#125;,</span></span><br><span class="line"><span class="comment">		*/</span></span><br><span class="line">	<span class="punctuation">]</span></span><br><span class="line"><span class="punctuation">&#125;</span></span><br><span class="line"></span><br></pre></td></tr></table></figure>

<h3 id="3-6-运行任务"><a href="#3-6-运行任务" class="headerlink" title="3.6 运行任务"></a><font size=3>3.6 运行任务</font></h3><p>我们按以下步骤运行任务：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224162547354.png" alt="image-20231224162547354" />

<p>这是个编译命令，然后就会启动编译过程，去编译bluetooth.light_ctl@tc825x这个demo，然后就会创建一个新的终端输出编译信息：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224162739896.png" alt="image-20231224162739896" />

<p>编译完成后会有如下提示，我们按下任意按键，这个终端就会关闭。</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224162937907.png" alt="image-20231224162937907" />

<p>相关的编译过程的打印信息如下：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br></pre></td><td class="code"><pre><span class="line"> *  正在文件夹 d%3A%5CMyLinux%5Cgenie-bt-mesh%5Cgenie-bt-mesh-stack 中执行任务: aos make bluetooth.light_ctl@tc825x </span><br><span class="line"></span><br><span class="line">aos-cube version: 0.5.11</span><br><span class="line">Making config file for first time</span><br><span class="line">========liblt_8258.a========</span><br><span class="line">========8258 32k ret start========</span><br><span class="line">========8258 32k ret boot link========</span><br><span class="line">processing components: bluetooth.light_ctl tc825x platform/mcu/tc32_825x osal init auto_component</span><br><span class="line">========liblt_8258.a========</span><br><span class="line">========8258 32k ret start========</span><br><span class="line">========8258 32k ret boot link========</span><br><span class="line">kernel_version:AOS-R-2.0.0</span><br><span class="line">all components: bluetooth.light_ctl tc825x platform/mcu/tc32_825x osal init auto_component genie_app bluetooth.bt_host bluetooth.bt_mesh yloop cli platform/arch/tc32 libc rhino hal rhino.vfs rhino.fs.kv crc bluetooth.bt_common bluetooth.bt_mesh.ref_impl log kernel.rhino.vfs.device</span><br><span class="line">========liblt_8258.a========</span><br><span class="line">========8258 32k ret start========</span><br><span class="line">========8258 32k ret boot link========</span><br><span class="line">kernel_version:AOS-R-2.0.0</span><br><span class="line">Build AOS Now</span><br><span class="line">TOOLCHAIN_PATH=D:\MyLinux\genie-bt-mesh\genie-bt-mesh-stack\build/compiler/tc32/bin/</span><br><span class="line">Compiling light_ctl</span><br><span class="line">Compiling tc825x</span><br><span class="line">Compiling tc32_825x</span><br><span class="line">app/example/bluetooth/light_ctl/light_ctl.c: In function &#x27;light_state_store&#x27;:</span><br><span class="line">app/example/bluetooth/light_ctl/light_ctl.c:106:22: warning: unused variable &#x27;pu&#x27;</span><br><span class="line">platform/mcu/tc32_825x/aos/soc_impl.c: In function &#x27;soc_get_cur_sp&#x27;:</span><br><span class="line">platform/mcu/tc32_825x/aos/soc_impl.c:138:1: warning: control reaches end of non-void function</span><br><span class="line">platform/mcu/tc32_825x/hal/timer.c: In function &#x27;hal_timer_stop&#x27;:</span><br><span class="line">platform/mcu/tc32_825x/hal/timer.c:93:2: warning: &#x27;return&#x27; with a value, in function returning void</span><br><span class="line">Compiling osal</span><br><span class="line">Compiling kernel_init</span><br><span class="line">Compiling auto_component</span><br><span class="line">Compiling genie_app</span><br><span class="line">genie_app/base/genie_flash.c:60:1: warning: useless storage class specifier in empty declaration</span><br><span class="line">genie_app/base/genie_flash.c: In function &#x27;_genie_flash_copy&#x27;:</span><br><span class="line">genie_app/base/genie_flash.c:502:14: warning: unused variable &#x27;flag_offset&#x27;</span><br><span class="line">genie_app/bluetooth/host/profile/ais_srv/ais_service.c:184:13: warning: &#x27;_ais_execute_disconnet&#x27; declared &#x27;static&#x27; but never defined</span><br><span class="line">Compiling bt_host</span><br><span class="line">Compiling bt_mesh</span><br><span class="line">Compiling yloop </span><br><span class="line">Compiling cli </span><br><span class="line">Compiling tc32 </span><br><span class="line">Compiling newlib_stub </span><br><span class="line">platform/arch/tc32/port_c.c: In function &#x27;cpu_intrpt_save&#x27;:</span><br><span class="line">platform/arch/tc32/port_c.c:52:1: warning: control reaches end of non-void function</span><br><span class="line">Compiling rhino </span><br><span class="line">Compiling hal </span><br><span class="line">Compiling vfs </span><br><span class="line">Compiling kv </span><br><span class="line">Compiling crc </span><br><span class="line">Compiling bt_common </span><br><span class="line">Compiling ref_impl </span><br><span class="line">network/bluetooth/bt_common/port/aos_port.c: In function &#x27;irq_lock&#x27;:</span><br><span class="line">network/bluetooth/bt_common/port/aos_port.c:176:5: warning: &#x27;cpsr&#x27; is used uninitialized in this function</span><br><span class="line">Compiling log </span><br><span class="line">Compiling vfs_device </span><br><span class="line">Making out/bluetooth.light_ctl@tc825x/libraries/light_ctl.a</span><br><span class="line">Making out/bluetooth.light_ctl@tc825x/libraries/tc825x.a</span><br><span class="line">Making out/bluetooth.light_ctl@tc825x/libraries/tc32_825x.a</span><br><span class="line">Making out/bluetooth.light_ctl@tc825x/libraries/osal.a</span><br><span class="line">Making out/bluetooth.light_ctl@tc825x/libraries/kernel_init.a</span><br><span class="line">Making out/bluetooth.light_ctl@tc825x/libraries/auto_component.a</span><br><span class="line">Making out/bluetooth.light_ctl@tc825x/libraries/genie_app.a</span><br><span class="line">Making out/bluetooth.light_ctl@tc825x/libraries/bt_host.a</span><br><span class="line">Making out/bluetooth.light_ctl@tc825x/libraries/bt_mesh.a</span><br><span class="line">Making out/bluetooth.light_ctl@tc825x/libraries/yloop.a</span><br><span class="line">Making out/bluetooth.light_ctl@tc825x/libraries/cli.a</span><br><span class="line">Making out/bluetooth.light_ctl@tc825x/libraries/tc32.a</span><br><span class="line">Making out/bluetooth.light_ctl@tc825x/libraries/newlib_stub.a</span><br><span class="line">Making out/bluetooth.light_ctl@tc825x/libraries/rhino.a</span><br><span class="line">Making out/bluetooth.light_ctl@tc825x/libraries/hal.a</span><br><span class="line">Making out/bluetooth.light_ctl@tc825x/libraries/vfs.a</span><br><span class="line">Making out/bluetooth.light_ctl@tc825x/libraries/kv.a</span><br><span class="line">Making out/bluetooth.light_ctl@tc825x/libraries/crc.a</span><br><span class="line">Making out/bluetooth.light_ctl@tc825x/libraries/bt_common.a</span><br><span class="line">Making out/bluetooth.light_ctl@tc825x/libraries/ref_impl.a</span><br><span class="line">Making out/bluetooth.light_ctl@tc825x/libraries/log.a</span><br><span class="line">Making out/bluetooth.light_ctl@tc825x/libraries/vfs_device.a</span><br><span class="line">Making bluetooth.light_ctl@tc825x.elf</span><br><span class="line"></span><br><span class="line">Making bluetooth.light_ctl@tc825x.bin</span><br><span class="line">Making bluetooth.light_ctl@tc825x.hex</span><br><span class="line">no definite address hint,using default mem configuration</span><br><span class="line">Making bluetooth.light_ctl@tc825x.lst</span><br><span class="line"></span><br><span class="line">                        AOS MEMORY MAP</span><br><span class="line">|=================================================================|</span><br><span class="line">| MODULE                                   | ROM       | RAM      |</span><br><span class="line">|=================================================================|</span><br><span class="line">| genie_app                                | 0         | 25827    |</span><br><span class="line">| log                                      | 0         | 478      |</span><br><span class="line">| ref_impl                                 | 0         | 795      |</span><br><span class="line">| bt_common                                | 0         | 15500    |</span><br><span class="line">| bt_mesh                                  | 0         | 62362    |</span><br><span class="line">| crc                                      | 0         | 184      |</span><br><span class="line">| libsoft-fp                               | 0         | 1900     |</span><br><span class="line">| osal                                     | 0         | 414      |</span><br><span class="line">| tc32_825x                                | 0         | 18730    |</span><br><span class="line">| cli                                      | 0         | 9740     |</span><br><span class="line">| kernel_init                              | 0         | 24       |</span><br><span class="line">| tc32                                     | 0         | 424      |</span><br><span class="line">| rhino                                    | 0         | 20225    |</span><br><span class="line">| bt_host                                  | 0         | 46945    |</span><br><span class="line">| liblt_8258                               | 0         | 24648    |</span><br><span class="line">| light_ctl                                | 0         | 3003     |</span><br><span class="line">| tc825x                                   | 0         | 301      |</span><br><span class="line">|=================================================================|</span><br><span class="line">| TOTAL (bytes)                            | 0         | 231500   |</span><br><span class="line">|=================================================================|</span><br><span class="line">Adding Check bluetooth.light_ctl@tc825x.bin </span><br><span class="line">output done!</span><br><span class="line">Build complete</span><br><span class="line">Making .gdbinit</span><br><span class="line"> *  终端将被任务重用，按任意键关闭。 </span><br></pre></td></tr></table></figure>

<h1 id="二、工程创建"><a href="#二、工程创建" class="headerlink" title="二、工程创建"></a><font size=3>二、工程创建</font></h1><h2 id="1-添加环境变量"><a href="#1-添加环境变量" class="headerlink" title="1. 添加环境变量"></a><font size=3>1. 添加环境变量</font></h2><p>【注意】后面经过实践发现这里不支持在源码外创建工程，所以这里添加环境变量可以不进行。</p>
<p>这里同样是使用aos工具，我们能否像AliOSThings一样在源码外创建工程呢？我们执行以下命令：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line">20380@qidaink MINGW64 /d/MyLinux/genie-bt-mesh/genie-bt-mesh-stack (master)</span><br><span class="line"><span class="meta prompt_">$ </span><span class="language-bash"><span class="built_in">cd</span> ..</span></span><br><span class="line"></span><br><span class="line">20380@qidaink MINGW64 /d/MyLinux/genie-bt-mesh</span><br><span class="line"><span class="meta prompt_">$ </span><span class="language-bash">aos create project -b tc825x -t helloworld_demo helloworld_tc825x</span></span><br><span class="line">[AliOS-Things] ERROR: No AliOS Things source directory found. To make things work, please:</span><br><span class="line">[AliOS-Things] ERROR: </span><br><span class="line">[AliOS-Things] ERROR: -&gt; Set AOS_SDK_PATH environment variable to a valid</span><br><span class="line">[AliOS-Things] ERROR:    AliOS-Things source directory as below:</span><br><span class="line">[AliOS-Things] ERROR:</span><br><span class="line">[AliOS-Things] ERROR:      * Linux/MacOS/Git-Bash:</span><br><span class="line">[AliOS-Things] ERROR:          $ export AOS_SDK_PATH=&lt;path_to_AliOS_Things_src&gt;</span><br><span class="line">[AliOS-Things] ERROR:      * Windows CMD:</span><br><span class="line">[AliOS-Things] ERROR:          &gt; set AOS_SDK_PATH=&lt;path_to_AliOS_Things_src&gt;</span><br><span class="line">[AliOS-Things] ERROR:</span><br><span class="line">[AliOS-Things] ERROR:    Please set it on system level if you want so.</span><br><span class="line">---</span><br></pre></td></tr></table></figure>

<p>不出意外，出现了报错，报错原因是找不到AOS_SDK_PATH，那么我们在windows中的环境变量中添加一个：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224163657374.png" alt="image-20231224163657374" />

<p>我们可以在终端打印一下（由于我使用的是git-bash，它支持echo命令）：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">echo $AOS_SDK_PATH</span><br></pre></td></tr></table></figure>

<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224164040634.png" alt="image-20231224164040634" />

<p>刚设置完成是不生效的，需要我们重启一下电脑。</p>
<h2 id="2-创建工程"><a href="#2-创建工程" class="headerlink" title="2. 创建工程"></a><font size=3>2. 创建工程</font></h2><p>我们回到上一级目录，然后执行以下命令创建：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">aos create project -b tc825x -t helloworld helloworld_tc825x</span><br></pre></td></tr></table></figure>

<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224164453888.png" alt="image-20231224164453888" />

<p>然后又报错了，我去查了一下AliOSThings源码的对应的目录，人家是有这个gen_newproject.py文件的，而蓝牙的协议栈则没有：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224164608705.png" alt="image-20231224164608705" />

<p>所以很显然，这里不支持喽，那我们就乖乖的在example目录下创建自己的工程吧。我们来到app\example\bluetooth目录下，将原来的helloworld复制一份：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">cp helloworld helloworld_tc825x -r</span><br></pre></td></tr></table></figure>

<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224165221702.png" alt="image-20231224165221702" />

<p>并且需要修改目录下的文件名，好像是要和目录名保持一致，因为我后面报错了：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224165943002.png" alt="image-20231224165943002" />

<p>所以这里直接修改文件名字如下：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224170006187.png" alt="image-20231224170006187" style="zoom:50%;" />

<h2 id="3-修改代码"><a href="#3-修改代码" class="headerlink" title="3. 修改代码"></a><font size=3>3. 修改代码</font></h2><h3 id="3-1-helloworld-tc825x-c"><a href="#3-1-helloworld-tc825x-c" class="headerlink" title="3.1 helloworld_tc825x.c"></a><font size=3>3.1 helloworld_tc825x.c</font></h3><p>我们会发现里面只有一个helloworld_tc825x.c源码文件，我们删除里面原有的，并添加以下代码：</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#<span class="keyword">include</span> <span class="string">&lt;stdio.h&gt;</span></span></span><br><span class="line"><span class="meta">#<span class="keyword">include</span> <span class="string">&lt;aos/aos.h&gt;</span></span></span><br><span class="line"></span><br><span class="line"><span class="type">int</span> <span class="title function_">application_start</span><span class="params">(<span class="type">int</span> argc, <span class="type">char</span> **argv)</span></span><br><span class="line">&#123;</span><br><span class="line">    <span class="built_in">printf</span>(<span class="string">&quot;BUILD_TIME:%s\n&quot;</span>, __DATE__<span class="string">&quot;,&quot;</span>__TIME__);</span><br><span class="line"></span><br><span class="line">    <span class="keyword">while</span>(<span class="number">1</span>)</span><br><span class="line">    &#123;</span><br><span class="line">        <span class="built_in">printf</span>(<span class="string">&quot;Hello World\r\n&quot;</span>);</span><br><span class="line">        aos_msleep(<span class="number">1000</span>);</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="keyword">return</span> <span class="number">0</span>;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h3 id="3-2-makefile文件"><a href="#3-2-makefile文件" class="headerlink" title="3.2 makefile文件"></a><font size=3>3.2 makefile文件</font></h3><p>我们将makefile中的一些名称也都修改为helloworld_tc825x：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224170200465.png" alt="image-20231224170200465" />

<p>只需要修改这两个地方即可</p>
<h2 id="4-编译工程"><a href="#4-编译工程" class="headerlink" title="4. 编译工程"></a><font size=3>4. 编译工程</font></h2><p>我们进入到工程目录，执行以下命令：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">aos make bluetooth.helloworld_tc825x@tc825x</span><br></pre></td></tr></table></figure>

<p>然后就会开始编译，编译成功会有如下打印信息：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224170308922.png" alt="image-20231224170308922" />

<h2 id="5-成果物在哪？"><a href="#5-成果物在哪？" class="headerlink" title="5. 成果物在哪？"></a><font size=3>5. 成果物在哪？</font></h2><p>我们编译完了，最后生成的可执行文件在哪？最终生成的可执行文件都在源码顶层目录的out目录中：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224170513025.png" alt="image-20231224170513025" />

<p>我们进入out\bluetooth.helloworld_tc825x@tc825x\binary中就会看到生成的所有可执行文件：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224170617445.png" alt="image-20231224170617445" />

<h1 id="三、烧写程序"><a href="#三、烧写程序" class="headerlink" title="三、烧写程序"></a><font size=3>三、烧写程序</font></h1><h2 id="1-硬件连接"><a href="#1-硬件连接" class="headerlink" title="1. 硬件连接"></a><font size=3>1. 硬件连接</font></h2><p>蓝牙模块并没有之前的OTA，而且我们需要使用仿真器对其进行烧写，仿真器与蓝牙模块连接如下（我们需要三根杜邦线来连接）：</p>
<table>
<thead>
<tr>
<th align="center">设备</th>
<th align="center">电源正极</th>
<th align="center">烧录引脚</th>
<th align="center">电源负极</th>
</tr>
</thead>
<tbody><tr>
<td align="center">下载器</td>
<td align="center">3V3</td>
<td align="center">SWM</td>
<td align="center">GND</td>
</tr>
<tr>
<td align="center">泰凌微8258</td>
<td align="center">3.3V</td>
<td align="center">PA7</td>
<td align="center">GND</td>
</tr>
</tbody></table>
<p>实物连接如下图所示：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224171841137.png" alt="image-20231224171841137" style="zoom:33%;" />

<p>可以看到两个板子还有另一端接了USB线，他们都需要接到电脑的USB口。</p>
<h2 id="2-烧写软件使用方式"><a href="#2-烧写软件使用方式" class="headerlink" title="2. 烧写软件使用方式"></a><font size=3>2. 烧写软件使用方式</font></h2><p>其实官网有个文档，有说明的<a target="_blank" rel="noopener" href="https://wiki.telink-semi.cn/wiki/IDE-and-Tools/Burning-and-Debugging-Tools-for-all-Series/">Burning and Debugging Tools for all Series - Telink wiki (telink-semi.cn)</a>。</p>
<h3 id="2-1-选择芯片型号"><a href="#2-1-选择芯片型号" class="headerlink" title="2.1 选择芯片型号"></a><font size=3>2.1 选择芯片型号</font></h3><p>我们打开BDT这个软件，然后选择芯片型号，点击SWS查看是否连接成功。</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224173611879.png" alt="image-20231224173611879" />

<p>需要注意的是，我最开始下了通用版本5.7.5，它里面我没找到8258，但是选B85这个型号的话也能连接成功并进行烧录，并且也成功了：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224184755255.png" alt="image-20231224184755255"  />

<p>但是吧，有可能falsh大小之类的有所不同吧，没找到相关的东西，就用了以前的5.6.0版本，那个里面是有8258的。然后我在这里看到了这个B85：<a target="_blank" rel="noopener" href="https://wiki.telink-semi.cn/wiki/Hardware/B85_Mesh_Starter_Kit_Hardware_Guide/">B85 Mesh Starter Kit - Telink wiki (telink-semi.cn)</a></p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224184839784.png" alt="image-20231224184839784" />

<p>这里写，B85 Mesh Starter Kit是基于TLSR8258的硬件平台，所以选它也行，反正目前暂时没什么问题。</p>
<h3 id="2-2-擦除flash"><a href="#2-2-擦除flash" class="headerlink" title="2.2 擦除flash"></a><font size=3>2.2 擦除flash</font></h3><p>我们点击Erase擦除，然后就会擦除所有的扇区：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224174318921.png" alt="image-20231224174318921" />

<h3 id="2-3-烧写可执行文件"><a href="#2-3-烧写可执行文件" class="headerlink" title="2.3 烧写可执行文件"></a><font size=3>2.3 烧写可执行文件</font></h3><img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224174145676.png" alt="image-20231224174145676" />

<p>然后就会开始烧写程序，烧写完成后，会有如下提示：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224174213061.png" alt="image-20231224174213061" />

<h1 id="四、重启测试"><a href="#四、重启测试" class="headerlink" title="四、重启测试"></a><font size=3>四、重启测试</font></h1><p>我这里选择使用MobaXterm作为串口终端，我们这里波特率需要配置为 921600：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224174531457.png" alt="image-20231224174531457" style="zoom:25%;" />

<p>然后按一下开发板上的RST按键，位于右上角，复位重启后我们会看到如下打印信息:</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E5%BC%80%E5%8F%91-01-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/img/image-20231224174650086.png" alt="image-20231224174650086" />

<p>开发板会不断打印hello world。</p>

    </div>

    
    
    

    <footer class="post-footer">




    <div>
        
            <div style="text-align:center;color: #ccc;font-size:14px;">
            ----------本文结束
            <i class="fas fa-fan fa-spin" style="color: #FF1493; font-size: 1rem"></i>
            感谢您的阅读----------
            </div>
        
    </div>





  
  <div class="my_post_copyright"> 
    <p><span>文章标题:</span><a href="/post/e0ca430.html">LV03-04-天猫蓝牙Mesh开发-01-环境搭建</a></p>
    <p><span>文章作者:</span><a href="/" title="欢迎访问 《苏木》 的学习笔记">苏木</a></p>
    <p><span>发布时间:</span>2024年01月07日 - 11:45</p>
    <p><span>最后更新:</span>2025年06月14日 - 00:25</p>
    <p><span>原始链接:</span><a href="/post/e0ca430.html" title="LV03-04-天猫蓝牙Mesh开发-01-环境搭建">https://sumumm.github.io/post/e0ca430.html</a></p>
    <p><span>许可协议:</span><i class="fab fa-creative-commons"></i> <a rel="license" href= "https://creativecommons.org/licenses/by-nc-nd/4.0/" target="_blank" title="Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0)">署名-非商业性使用-禁止演绎 4.0 国际</a> 转载请保留原文链接及作者。</p>  
  </div>
  


          <div class="post-tags">
              <a href="/tags/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/" rel="tag"><i class="fa fa-tag"></i> LV21-天猫精灵IOT</a>
          </div>

        

          <div class="post-nav">
            <div class="post-nav-item">
                <a href="/post/4f7cfeeb.html" rel="prev" title="LV03-04-天猫蓝牙Mesh开发-02-呼吸灯实现">
                  <i class="fa fa-angle-left"></i> LV03-04-天猫蓝牙Mesh开发-02-呼吸灯实现
                </a>
            </div>
            <div class="post-nav-item">
                <a href="/post/8bed8e87.html" rel="next" title="LV03-03-蓝牙Mesh进阶-03-蓝牙Mesh模型">
                  LV03-03-蓝牙Mesh进阶-03-蓝牙Mesh模型 <i class="fa fa-angle-right"></i>
                </a>
            </div>
          </div>
    </footer>
  </article>
</div>






</div>
  </main>

  <footer class="footer">
    <div class="footer-inner">

  <div class="copyright">
    &copy; 2017 – 
    <span itemprop="copyrightYear">2025</span>
    <span class="with-love">
      <i class="fa fa-heart"></i>
    </span>
    <span class="author" itemprop="copyrightHolder">苏木</span>
  </div>
<div class="wordcount">
  <span class="post-meta-item">
    <span class="post-meta-item-icon">
      <i class="fa fa-chart-line"></i>
    </span>
      <span>站点总字数：</span>
    <span title="站点总字数">3.7m</span>
  </span>
  <span class="post-meta-item">
    <span class="post-meta-item-icon">
      <i class="fa fa-coffee"></i>
    </span>
      <span>站点阅读时长 &asymp;</span>
    <span title="站点阅读时长">225:26</span>
  </span>
</div>




    <span id="sitetime"></span>
    <script defer language=javascript>
        function siteTime()
        {
            window.setTimeout("siteTime()", 1000);
            var seconds = 1000;
            var minutes = seconds * 60;
            var hours = minutes * 60;
            var days = hours * 24;
            var years = days * 365;
            var today = new Date();
            var todayYear = today.getFullYear();
            var todayMonth = today.getMonth()+1;
            var todayDate = today.getDate();
            var todayHour = today.getHours();
            var todayMinute = today.getMinutes();
            var todaySecond = today.getSeconds();
            /*==================================================
            Date.UTC() -- 返回date对象距世界标准时间(UTC)1970年1月1日午夜之间的毫秒数(时间戳)
            year        - 作为date对象的年份，为4位年份值
            month       - 0-11之间的整数，做为date对象的月份
            day         - 1-31之间的整数，做为date对象的天数
            hours       - 0(午夜24点)-23之间的整数，做为date对象的小时数
            minutes     - 0-59之间的整数，做为date对象的分钟数
            seconds     - 0-59之间的整数，做为date对象的秒数
            microseconds - 0-999之间的整数，做为date对象的毫秒数
            ==================================================*/
            var t1 = Date.UTC(2017, 
                              5, 
                              19, 
                              0, 
                              0, 
                              0); //北京时间
            var t2 = Date.UTC(todayYear,todayMonth,todayDate,todayHour,todayMinute,todaySecond);
            var diff = t2-t1;
            var diffYears = Math.floor(diff/years);
            var diffDays = Math.floor((diff/days)-diffYears*365);
            var diffHours = Math.floor((diff-(diffYears*365+diffDays)*days)/hours);
            var diffMinutes = Math.floor((diff-(diffYears*365+diffDays)*days-diffHours*hours)/minutes);
            var diffSeconds = Math.floor((diff-(diffYears*365+diffDays)*days-diffHours*hours-diffMinutes*minutes)/seconds);
            document.getElementById("sitetime").innerHTML="已在这里 "+diffYears+" 年 "+diffDays+" 天 "+diffHours+" 小时 "+diffMinutes+" 分钟 "+diffSeconds+" 秒";
        }
        siteTime();
    </script>



    </div>
  </footer>

  
  <div class="back-to-top" role="button" aria-label="返回顶部">
    <i class="fa fa-arrow-up fa-lg"></i>
    <span>0%</span>
  </div>
  <div class="reading-progress-bar"></div>

<noscript>
  <div class="noscript-warning">Theme NexT works best with JavaScript enabled</div>
</noscript>


  
  <script src="https://cdnjs.cloudflare.com/ajax/libs/animejs/3.2.1/anime.min.js" integrity="sha256-XL2inqUJaslATFnHdJOi9GfQ60on8Wx1C2H8DYiN1xY=" crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/next-theme-pjax/0.6.0/pjax.min.js" integrity="sha256-vxLn1tSKWD4dqbMRyv940UYw4sXgMtYcK6reefzZrao=" crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/fancyapps-ui/5.0.28/fancybox/fancybox.umd.js" integrity="sha256-ytMJGN3toR+a84u7g7NuHm91VIR06Q41kMWDr2pq7Zo=" crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/lozad.js/1.16.0/lozad.min.js" integrity="sha256-mOFREFhqmHeQbXpK2lp4nA3qooVgACfh88fpJftLBbc=" crossorigin="anonymous"></script>
<script src="/js/comments.js"></script><script src="/js/utils.js"></script><script src="/js/motion.js"></script><script src="/js/next-boot.js"></script><script src="/js/pjax.js"></script>

  <script src="https://cdnjs.cloudflare.com/ajax/libs/hexo-generator-searchdb/1.4.1/search.js" integrity="sha256-1kfA5uHPf65M5cphT2dvymhkuyHPQp5A53EGZOnOLmc=" crossorigin="anonymous"></script>
<script src="/js/third-party/search/local-search.js"></script>




  <script src="/js/third-party/fancybox.js"></script>

  <script src="/js/third-party/pace.js"></script>


  




  

  <script class="next-config" data-name="enableMath" type="application/json">true</script><script class="next-config" data-name="mathjax" type="application/json">{"enable":true,"tags":"none","js":{"url":"https://cdnjs.cloudflare.com/ajax/libs/mathjax/3.2.2/es5/tex-mml-chtml.js","integrity":"sha256-MASABpB4tYktI2Oitl4t+78w/lyA+D7b/s9GEP0JOGI="}}</script>
<script src="/js/third-party/math/mathjax.js"></script>


 
        <div id="click-show-text"
            data-mobile = false
            data-text = 富强,民主,文明,和谐,自由,平等,公正,法制,爱国,敬业,诚信,友善
            data-fontsize = 15px
            data-random= false>
        </div>
       

      
        <script async src=https://cdn.jsdelivr.net/npm/hexo-next-mouse-effect@latest/click/showText.js></script>
      

      
    




    <script async src="/js/fancybox_param.js"></script>





<!-- APlayer本体 -->



</body>
</html>
